/**
 * Creates a new Hyperlink object.
 * 
 * @param {String} title for the Hyperlink
 * @param {String} the Hyperlink's URL
 */
Hyperlink.prototype.constructor = function(url, title) {
    // Check if the URL is valid
    if (!url || !url.isUrl()) {
        throw "Invalid URL!";
    }
    
    // Init the object and generate hash
    this.title  = title;
    this.url    = url;
    this.clicks = 0;
    
    // We need to persist bevor accessing _id for the hash!
    this.persist();
    this.hash = encodeHash(this._id);
}